package com.example.curriculum.service;

import com.example.curriculum.pojo.InBound;
import com.example.curriculum.repository.InBoundRepository;
import jakarta.annotation.Resource;
import org.springframework.stereotype.Service;

@Service
public class InBoundService implements IInBoundService {
    @Resource
    private InBoundRepository repo;

    @Override
    public InBound add(InBound inbound){
        repo.save(inbound);
        return repo.findById(inbound.getOrder_id());
    }

    @Override
    public InBound select(String order_id) {
        return repo.findById(order_id);
    }

    @Override
    public InBound update(InBound inbound) {
        repo.update(inbound);
        return repo.findById(inbound.getOrder_id());
    }

    @Override
    public void delete(String order_id) {
        repo.deleteById(order_id);
    }
}
